<?php

class AjaxcallModule extends fvModule {

    function __construct () {
        $moduleName = strtolower(substr(__CLASS__, 0, -6));

        parent::__construct(fvSite::$fvConfig->get("modules.{$moduleName}.smarty.template"), 
                            fvSite::$fvConfig->get("modules.{$moduleName}.smarty.compile"), 
                            fvSite::$Layoult);
    }

	function showChangeregion() {
		$cities[0] = "выберите населенный пункт";
        if (fvRequest::getInstance()->getRequestParameter("obl_id")) {
 			$tmp = fvSite::$DB->getAll("select * from sluga_city where parent_id=".fvRequest::getInstance()->getRequestParameter("obl_id")." order by name asc");
	        foreach ($tmp as $v){
        		$cities[$v["id"]] = $v["name"];
        	}
        }
        $this->__assign(array(
            'cities'    => $cities,
        ));
        return $this->__display('cities.tpl');
    }
}

?>
